package org.ali.creationalpattern.singletonpattern.singletonobject;

/**
 * 懒汉式，懒加载，线程安全，低性能
 */
public class SingletonObject3 {
    private static SingletonObject3 object;

    private SingletonObject3() {
    }

    public static synchronized SingletonObject3 getInstance() {
        if (object == null) {
            object = new SingletonObject3();
        }
        return object;
    }

    public void showMessage() {
        System.out.println("懒汉式，懒加载，线程安全，低性能");
    }
}
